#include <stdio.h>
#include <stdlib.h>
//7 勾股数
 int main(){
      int a,b,c,n;
      int ans=0;
      scanf("%d",&n);
      for(a=3;a<=n;a++){
          for(b=4;b<=n;b++){
              for(int c=5;c<=n;c++)
                if(a*a+b*b==c*c){
                    if(a<=b&&a<=c&&b<=c)
                        printf("%d %d %d\n",a,b,c);
             }
         }
    }
     return 0;
 }
